package com.game.controllers;

import com.game.objects.Environment;
import com.game.objects.Player;
import com.jme.math.FastMath;
import com.jme.scene.Controller;

public class TurboController extends Controller{
	private Player player;
	private Environment ev;
	private float lifeTime=5;
	public TurboController(Player player, Environment ev){
		this.player = player;
		this.ev = ev;
		ev.setSpeed(150f);
		player.getParticles().setMaximumAngle(FastMath.DEG_TO_RAD*50);
	}
	public void update(float time) {
		lifeTime -= time;
		if (lifeTime < 0) {
			ev.setSpeed(ev.baseSpeed);
			player.getParticles().setMaximumAngle(FastMath.DEG_TO_RAD*2);
			player.getPlayer().removeController(this);
			return;
		}
	}
}